<%@page import="java.util.Date"%>
<%@page import="java.text.*"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="cn.school.dao1.*,cn.school.service1.*,cn.school.entity.*" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
request.setCharacterEncoding("utf-8");
String stuno=request.getParameter("stuno");
long stuno1 = Long.parseLong(stuno);
String sname=request.getParameter("sname");
String sex=request.getParameter("sex");
String telephone=request.getParameter("telephone");
String qq=request.getParameter("qq");
String wechat=request.getParameter("wechat");
String gradeid=request.getParameter("gradeid");
long grade = Long.parseLong(gradeid);
String enterdate=request.getParameter("enterdate");
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
Date enterd = sf.parse(enterdate);
String fromcity=request.getParameter("fromcity");
String birthday=request.getParameter("birthday");
Date birth = sf.parse(birthday);
String address=request.getParameter("address");
String pass=request.getParameter("pass");

Service4 service=new Service4();
Student stu=new Student();
stu.setStuno(stuno1);
stu.setSname(sname);
stu.setSex(sex);
stu.setTelephone(telephone);
stu.setQq(qq);
stu.setWechat(wechat);
stu.setGradeid(grade);
stu.setEnterdate(enterd);
stu.setFromcity(fromcity);
stu.setBirthday(birth);
stu.setAddress(address);
stu.setPass(pass);

int i=service.add(stu);
out.print("增加了"+i+"行");
%>
</body>
</html>